{# Copyright The IETF Trust 2007, All Rights Reserved #}
{% load ietf_filters %}
<table class="table table-sm table-striped tablesorter">
    <thead>
        <tr>
            <th scope="col" data-sort="date">Date</th>
            <th scope="col" data-sort="from">From</th>
            <th scope="col" class="d-none d-sm-table-cell" data-sort="to">To</th>
            <th scope="col" class="d-none d-sm-table-cell" data-sort="deadline-date">Deadline</th>
            <th scope="col" data-sort="title">Title</th>
        </tr>
    </thead>
    {% if liaisons %}
        <tbody>
            {% for liaison in liaisons %}
                <tr>
                    <td>{{ liaison.sort_date|date:"Y-m-d" }}</td>
                    <td class="liaison-group-col">{{ liaison.from_groups_display }}</td>
                    <td class="liaison-group-col d-none d-sm-table-cell">{{ liaison.to_groups_display }}</td>
                    <td class="d-none d-sm-table-cell">
                        {{ liaison.deadline|default:"-"|date:"Y-m-d" }}
                        {% if liaison.deadline and not liaison.action_taken %}
                            <br>
                            <span title="{{ liaison.is_outgoing|yesno:'Outgoing,Incoming' }} liaison"
                                  class="badge rounded-pill
                                         {% if liaison.is_outgoing %}
                                             text-bg-warning
                                         {% else %}
                                             text-bg-info
                                         {% endif %}">Action needed</span>
                        {% endif %}
                    </td>
                    <td>
                        <a href="{% url "ietf.liaisons.views.liaison_detail" object_id=liaison.pk %}">{{ liaison.title }}</a>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    {% endif %}
</table>